<div class="row">
  <div class="col-xs-12">
    <%= render partial: 'common/nav', locals: {show_tab: :index, model_nav_name: :admin_user, pjax: false} %>
    <%= form_for 'User', url: admin_users_destroy_multi_path, method: :post do %>
        <button class="btn btn-minier btn-danger" type="submit"><i class="icon-trash"></i> <%= t 'common.delete_multi' %></button>
        <div id="admin_users">
          <%= grid(@users, show_filters: :when_filtered) do |g|
            g.action_column param_name: :select_ids, object_property: :id
            g.column name: "#{t 'activerecord.attributes.defaults.id'}", attribute: 'id', filter: false, ordering: true
            g.column name: "#{t 'activerecord.attributes.user.name'}", attribute: 'name' do |c|
              link_to c.name, admin_user_path(c.id), class: :pjax
            end
            g.column name: "#{t 'activerecord.attributes.user.email'}", attribute: 'email'
            g.column name: "#{t 'activerecord.attributes.user.phone'}", attribute: 'phone'
            g.column name: "#{t 'activerecord.attributes.user.organization'}", attribute: 'organization_id' do |c|
              c.organization.name if c.organization_id.present?
            end
            g.column name: "#{t 'activerecord.attributes.user.remark'}", attribute: 'remark'
            g.column do |c|
              grid_operator(:admin_user_path, c.id)
            end
          end %>
        </div>
    <% end %>

    <script>
        $(function () {
            $('.nav.nav-list li.active').removeClass('active');
            $('.nav.nav-list li[data-model="user_list"]').addClass('active');
        });
    </script>
  </div>
</div>